#pragma once

#include <vector>
#include <string>

/**
 * @file gateway_config.h
 * @brief Device configuration file.
 *
 * On instantiation, the object gets all device names and applies default configuration;
 * all later changes are based on this setup.
 *
 * @note Loading functions are not finished.
 */

class GatewayConfig {
 public:
    /// Network device configuration.
    struct DeviceConfig {
        std::string name;
        bool promiscuous;
        int buffer_size;
        int timeout_ms;
        std::string filter;
    };
    /// @brief Call setDefaults. Retrieve all device names.
    GatewayConfig();

    /// Method for loading configuration.
    bool loadFromFile(const std::string& filename);
    bool loadFromCommandLine(int argc, char* argv[]);
    void setDefaults();

    // Access interface.
    const std::vector<DeviceConfig>& deviceConfigs() const { return m_deviceConfigs; }

    // @brief Check the configuration.
    bool validate() const;

 private:
    std::vector<DeviceConfig> m_deviceConfigs;
};